package com.jfeat.am.module.wegou.services.domain.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.jfeat.am.module.wegou.services.domain.dao.QueryProductDao;
import com.jfeat.am.module.wegou.services.domain.service.QueryProductService;
import com.jfeat.am.module.wegou.services.persistence.model.Product;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author admin
 * @since 2017-10-16
 */
@Service
public class QueryProductServiceImpl implements QueryProductService {

    @Resource
    QueryProductDao queryProductDao;

    // 根据 typeName 搜索料理 (cuisine) 店， 并且根据升序 返回搜索结果

    @Override
    public List<Map<String,Object>> findProductByType(Page<Map<String,Object>> page,
                                                     String status,
                                                     String typeName,
                                                     String zhTypeName,
                                                     String name,
                                                     String zhName,
                                                     Long productTypeId,
                                                     Long storeId) {
        return queryProductDao.findProductByType(page, status, typeName, zhTypeName,name,zhName,productTypeId, storeId);
    }

    @Override
    public List<Map<String,Object>> findProductByType(String status,
                                                      String typeName,
                                                      String zhTypeName,
                                                      String name,
                                                      String zhName,
                                                      Long productTypeId,
                                                      Long storeId) {
        return queryProductDao.findProductByType(status, typeName, zhTypeName,name,zhName,productTypeId, storeId);
    }

    @Override
    public List<Map<String,Object>> findProductPage(Page<Map<String,Object>> page, Product product) {
        return queryProductDao.findProductPage(page, product);
    }
}
